<?php

namespace app\controller;


use app\service\FeedBackService;
use const support\ERROR;
use const support\feed_back_type_3;
use const support\OPERATE_ERROR;

class FeedBackController
{

    //提交意见反馈
    public function toSubmitFeedBack(): \support\Response
    {
        //接收前端传参
        $params=getRequestData([
            'type'          =>feed_back_type_3,
            'content'	    =>'',
            'images'	    =>'',
        ]);
        try {
            $ret=FeedBackService::toAdd(getMemberId(),$params);
            if (!$ret){
                return buildFail(OPERATE_ERROR,'提交意见反馈失败');
            }
            return buildSuccess();
        }catch (\Throwable $e){
            return buildFail(ERROR,$e->getMessage());
        }
    }

}